<template>
  <div>
    <div>
      <el-button @click="content = ''">重置</el-button>
      <el-button @click="formSubmit">提交</el-button>
    </div>
    <ckeditor :editor="editor" v-model="content" :config="editorConfig" @ready="ckeditorReady"/>
  </div>
</template>

<script>
import editor from '@/components/CKEditor5/ckeditor'
import CustomUploadAdapter from '@/components/CKEditor5/uploadAdapter'

export default {
  name: 'CKEditorTest',
  data () {
    return {
      editor,
      editorConfig: {},
      content: ''
    }
  },
  methods: {
    ckeditorReady (editor) {
      editor.plugins.get('FileRepository').createUploadAdapter = (loader) => {
        return new CustomUploadAdapter(loader)
      }
    },
    formSubmit () {
      console.log(this.content)
    }
  }
}
</script>

<style scoped>

</style>
